<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title','后台管理系统')</title>
    <link rel="stylesheet" href="{{asset('css/bootstrap.min.css')}}">
    <link rel="stylesheet" href="{{asset('css/back/ie10-viewport-bug-workaround.css')}}">
    <link rel="stylesheet" href="{{asset('css/back/dashboard.css')}}">
    <link rel="stylesheet" href="{{asset('css/back/input.css')}}">
    <link rel="stylesheet" href="{{asset('css/back/index.css')}}">
    <link href="{{asset('css/back/banner.css')}}" rel="stylesheet" type="text/css" />
    <script src="{{URL::asset('/home/js/jquery-2.1.4.min.js')}}"></script>
    <script src="{{URL::asset('/home/js/bootstrap.min.js')}}"></script>
    <script src="{{asset('/js/back/jquery-1.10.2.min.js')}}"></script>
    <style>
        #menus ul{
            display:none;
        }
        #menus h5{
            cursor: pointer;
        }
        img{
            width:192px;
            height:108px;
        }
    </style>
</head>
<script>
    $(function(){
        $('#menus h5').click(function(){
            // 当前h5的下一个ul做下拉切换,其他的ul全部关闭
            $(this).next('ul').slideToggle().siblings('ul').slideUp();
        })
    })
</script>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top" style="background-color: #25313F;">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div style="float:left;background-color: #1b252e;height:50px;width:330px;">
                <a class="navbar-brand" href="#" style="color: #adbece;">欢迎管理员{{session('user')}}登入后台</a> &nbsp; <a href="{{url('back/setse')}}" class="navbar-brand" style="color: #adbece;">退出登入</a>
            </div>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Dashboard</a></li>
                <li><a href="#">Settings</a></li>
                <li><a href="#">Profile</a></li>
                <li><a href="#">Help</a></li>
            </ul>
            <form class="navbar-form navbar-right">
                <input type="text" class="form-control" placeholder="Search...">
            </form>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div style="top:50px;" class="col-sm-3 col-md-2 sidebar index_one" id="menus">
            <a href="{{url('back/index')}}"><h5><span class="glyphicon glyphicon-home"></span>首页</h5></a>
            <h5><span class="glyphicon glyphicon-home"></span>权限管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/power')}}" style="color: rgb(173, 190, 206);">权限管理</a></li>
                <li><a href="{{url('back/role')}}" style="color: rgb(173, 190, 206);">角色管理</a></li>
                <li><a href="{{url('back/strator')}}" style="color: rgb(173, 190, 206);">管理员管理</a></li>
            </ul>
            <h5><span class="glyphicon glyphicon-user"></span>用户管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/read/news')}}" style="color: rgb(173, 190, 206);">用户信息管理</a></li>
                <li><a href="{{url('back/read/purchase')}}" style="color: rgb(173, 190, 206);">用户订单管理</a></li>
                <li><a href="{{url('back/read/gomoney')}}" style="color: rgb(173, 190, 206);">用户充值管理</a></li>
                <li><a href="" style="color: rgb(173, 190, 206);">用户反馈管理</a></li>
                <li><a href="{{url('back/read/addreaduser')}}" style="color: rgb(173, 190, 206);">添加用户</a></li>
            </ul>
            <h5><span class="glyphicon glyphicon-book"></span>作者管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/writer/useradd')}}" style="color: rgb(173, 190, 206);">添加作家</a></li>
                <li><a href="{{url('back/writer/userList')}}" style="color: rgb(173, 190, 206);">作者信息管理</a></li>
                <li><a href="{{url('back/writer/books')}}" style="color: rgb(173, 190, 206);">作家书籍管理</a></li>
                <li><a href="{{url('back/writer/income')}}" style="color: rgb(173, 190, 206);">作家收入管理</a></li>
                <li><a href="{{url('back/writer/userTalk')}}" style="color: rgb(173, 190, 206);">作家咨询管理</a></li>
                <li><a href="{{url('back/writer/publish')}}" style="color: rgb(173, 190, 206);">发布新闻</a></li>
                <li><a href="{{url('back/writer/newList')}}" style="color: rgb(173, 190, 206);">新闻管理</a></li>
            </ul>
            <h5><span class="glyphicon glyphicon-th"></span>作家中心管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/center/course')}}" style="color: rgb(173, 190, 206);">课程管理</a></li>
                <li><a href="{{url('back/center/special')}}" style="color: rgb(173, 190, 206);">专栏管理</a></li>
                <li><a href="{{url('back/center/infomation')}}" style="color: rgb(173, 190, 206);">资讯管理</a></li>
            </ul>
            <h5><span class="glyphicon glyphicon-star"></span>轮播图管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/writer/flowing')}}" style="color: rgb(173, 190, 206);">作家区轮播图管理</a></li>
                <li><a href="{{url('back/center/home_figure')}}" style="color: rgb(173, 190, 206);">
                    读者区轮播图管理
                    </a></li>
            </ul>
            <h5><span class="glyphicon glyphicon-eur"></span>出版社管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/presss/newpresss')}}" style="color: rgb(173, 190, 206);">出版社管理</a></li>
                <li><a href="{{url('back/presss/addpresss')}}" style="color: rgb(173, 190, 206);">添加出版社</a></li>
            </ul>
            <h5><span class="glyphicon glyphicon-eur"></span>反馈管理</h5>
            <ul class="nav nav-sidebar">
                <li><a href="{{url('back/feedback')}}" style="color: rgb(173, 190, 206);">读者用户反馈管理</a></li>
            </ul>
        </div>
        <div style="margin-top:67px;padding:0;width: 80.333333%;;;margin-left: 17.666667%" class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            @section('mian')
                <div id="banner_box" class="banner_box">
                    <div class="banner_cot">
                        <!--放banner页面-->
                        <div class="banner_list" id="banner_list">
                            <!--第一个页面 天空下的猫老师-->
                            <div class="page_box show">
                                <div class="bg_box">
                                    <img src="{{asset('image/back/image/sky_xia.png')}}" class="sky_xia sky_anim2" />
                                    <img src="{{asset('image/back/image/sky_shang.png')}}" />

                                </div>
                                <div class="content">
                                    <div class="main_box">
                                        <div class="sky_cot sky_anim2">
                                            <img src="{{asset('image/back/image/sky_cot2.png')}}" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--第二个页面 房间里的猫老师-->
                            <div class="page_box">
                                <div class="bg_box">
                                    <img src="{{asset('image/back/image/room_bg2.jpg')}}" />
                                </div>
                                <div class="content">
                                    <div class="main_box">
                                        <div class="room_cot">
                                            <div class="room_anim">
                                                <img src="{{asset('image/back/image/room_cot2.png')}}" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--第三个页面 雪中的猫老师-->
                            <div class="page_box  ">
                                <div class="bg_box">
                                    <img src="{{asset('image/back/image/snow_bg3.png')}}" />
                                </div>
                                <div class="content">
                                    <div class="main_box">
                                        <div class="snow_cot snow_anim">
                                            <img src="{{asset('image/back/image/snow_cot3.png')}}" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--第四个页面 森林中的猫老师-->
                            <div class="page_box ">
                                <div class="bg_box">
                                    <img src="{{asset('image/back/image/forest_bg4.jpg')}}" />
                                </div>
                                <div class="content">
                                    <div class="main_box">
                                        <div class="forest_cot forest_anim">
                                            <img src="{{asset('image/back/image/forest_cont2.png')}}" />
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            @show
        </div>
    </div>
</div>
<script>
    (function () {
        //2016-13-10 begin
        var $banner_box = $("#banner_box"),
            $pages = $("#banner_list").find(".page_box"),
            $mainBoxs = $pages.find(".main_box"),
            $bgs = $pages.find(".bg_box img"),
            $controlBox = $("#control_box"),
            $productBtns = $("#product_btns"),
            $controls = $controlBox.find("a");
        var data = {
            pLength: $pages.length,//记录一共有多少个page_box
            curP: 0,
            isCan: true,
            isOnbtn: false,
            fColor: [2, 2, 1, 1, 1],
            dur: 3500,
            cNum: 0
        };

        //自动轮播换页函数
        var cId;
        var pageChange = function (idx) {
            if (data.isOnbtn)
                return;
            if (idx >= -1 && idx < data.pLength && idx != data.curP && data.isCan) {
                data.isCan = false;
                data.cNum++;
                clearInterval(cId);//停止动画
                idx = idx == -1 ? data.pLength - 1 : idx;//条件表达式 真前假后 指向最后一张
                $controls.removeClass("icon_show").eq(idx).addClass("icon_show");
                $pages.eq(data.curP).css({ zIndex: 0 });
                $pages.eq(idx).addClass("show").css({ opacity: 0, zIndex: 1 }).animate({ opacity: 1 }, 400, function () {
                    $pages.eq(data.curP).removeClass("show");
                    $(this).addClass("show");
                    data.isCan = true;
                    data.curP = idx;
                    data.cNum--;
                    if (data.cNum == 0) {
                        //setInterval() 方法会不停地调用函数，直到 clearInterval() 被调用或窗口被关闭。
                        cId = setInterval(function () {
                            pageChange((data.curP + 1) % data.pLength);
                            //% 求余数 当要处理 X % Y时, 如果, X < Y 的话, 回传值就是 X 自己 1 % 4 = 1
                        }, data.dur);//data.dur 是时间
                    }
                });
            }
        }
        //鼠标经过 下方导航
        $controls.on("mouseenter", function () {
            data.isCan = true;
            pageChange($controls.index(this));
            data.isOnbtn = true;
        });
        $controls.on("mouseleave", function () {
            data.isOnbtn = false;
        });

        cId = setInterval(function () {
            pageChange((data.curP + 1) % data.pLength);
        }, data.dur);

        //网页自由缩放  2016-10-12 调整
        var isIE6 = navigator.userAgent.indexOf("MSIE 6.0") > 0;//获取浏览器的版本
        //调整
        //页面自缩放
        var resize = function () {
            var w = $(window).width(),
                h = $(window).height();

            $banner_box.height(h);
            if (w / h < 1920 / 1080) {
                $bgs.height(h).css({ width: "auto", margin: -.5 * h + "px 0 0 " + -.5 * 1920 / 1080 * h + "px" });

            } else {
                $bgs.width(w).css({ height: "auto", margin: -.5 * w * 1080 / 1920 + "px 0 0 " + -.5 * w + "px" });
            }
            resize_img(w, h);//调用函数 改变内容图片大小

            var imgH = $bgs.height();
            $mainBoxs.height(imgH).css("margin-top", -.5 * imgH + "px");
            var cls;
            switch (true) {
                case w >= 1600: { cls = "big_view"; break; }
                case w < 1600 && w >= 1440: { cls = "mid_view"; break; }
                case w < 1440: { cls = "small_view"; break; }
            }
            var ws = $banner_box[0].className;
            if (isIE6 && (ws.indexOf("big") != -1 || ws.indexOf("mid") != -1 || ws.indexOf("small") != -1) && ws.indexOf(cls) == -1)
                location.reload();
            banner_box.className = "banner_box " + cls;
        };
        $(window).resize(resize);
        resize();

        function resize_img(w, h) {
            var snoww = w * 593 / 1920,
                snowh = h * 448 / 1080;
            var roomw = w * 668 / 1920,
                roomh = h * 585 / 1080;
            var forestw = w * 500 / 1920,
                foresth = h * 636 / 1080;
            var skyw = w * 371 / 1920,
                skyh = h * 341 / 1080;
            if (w / h < 1920 / 1080) {
                //$(".snow_cot").height(snowh).css({ width: snowh * 宽 / 高 + "px", margin: "0 0 0" + -.5 * 宽 / 高 * snowh + "px" });
                $(".snow_cot").height(snowh).css({ width: snowh * 593 / 448 + "px", margin: "0 0 0" + -.5 * 593 / 448 * snowh + "px" });
                $(".room_cot").height(roomh).css({ width: roomh * 668 / 585 + "px", margin: "0 0 0" + -.5 * 400 / 585 * roomh + "px" });
                $(".forest_cot").height(foresth).css({ width: foresth * 500 / 636 + "px", margin: "0 0 0" + -.5 * 500 / 636 * foresth + "px" });
                $(".sky_cot").height(skyh).css({ width: skyh * 371 / 341 + "px" });

            } else {
                //$(".snow_cot").width(snoww).css({ height: snoww * 高 / 宽 + "px", margin: "0 0 0" + -.5 * snoww + "px" });
                $(".snow_cot").width(snoww).css({ height: snoww * 448 / 593 + "px", margin: "0 0 0" + -.5 * snoww + "px" });
                $(".room_cot").width(roomw).css({ height: roomw * 585 / 668 + "px", margin: "0 0 0" + -.5 * 400 * roomw / 668 + "px" });
                $(".forest_cot").width(forestw).css({ height: forestw * 636 / 500 + "px", margin: "0 0 0" + -.5 * forestw + "px" });
                $(".sky_cot").width(skyw).css({ height: skyw * 341 / 371 + "px" });
            }

        }
    })();
</script>
</body>
</html>
